<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: WireIt   Layer.js </title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1229176524.63" />
	<link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1229176524.63" />

    <script type="text/javascript" src="assets/api-js?stamp=1229176524.63"></script>
    <script type="text/javascript" src="assets/ac-js?stamp=1229176524.63"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="WireIt Framework">WireIt Framework</a></h1>
        <h3>WireIt&nbsp; <span class="subtitle">0.4.0</span></h3>
        <a href="./index.html" title="WireIt Framework">WireIt Framework</a> 
            &gt; <a href="./module_wireit.html" title="WireIt">WireIt</a>
                
                 &gt; Layer.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
<div class="highlight"><pre><span class="c">/**</span>
<span class="c"> * A layer encapsulate a bunch of containers and wires</span>
<span class="c"> * @class Layer</span>
<span class="c"> * @namespace WireIt</span>
<span class="c"> * @constructor</span>
<span class="c"> * @param {Object}   options   Configuration object (see the properties)</span>
<span class="c"> */</span>
<span class="nx">WireIt</span><span class="p">.</span><span class="nx">Layer</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">options</span><span class="p">)</span> <span class="p">{</span>
   
   <span class="k">this</span><span class="p">.</span><span class="nx">setOptions</span><span class="p">(</span><span class="nx">options</span><span class="p">);</span>
   
   <span class="c">/**</span>
<span class="c">    * List of all the WireIt.Container (or subclass) instances in this layer</span>
<span class="c">    * @property containers</span>
<span class="c">    * @type {Array}</span>
<span class="c">    */</span>
   <span class="k">this</span><span class="p">.</span><span class="nx">containers</span> <span class="o">=</span> <span class="p">[];</span>
   
   <span class="c">/**</span>
<span class="c">    * List of all the WireIt.Wire (or subclass) instances in this layer</span>
<span class="c">    * @property wires</span>
<span class="c">    * @type {Array}</span>
<span class="c">    */</span>
   <span class="k">this</span><span class="p">.</span><span class="nx">wires</span> <span class="o">=</span> <span class="p">[];</span>
   
   <span class="c">/**</span>
<span class="c">    * Layer DOM element</span>
<span class="c">    * @property el</span>
<span class="c">    * @type {HTMLElement}</span>
<span class="c">    */</span>
   <span class="k">this</span><span class="p">.</span><span class="nx">el</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
   
   
   <span class="c">/**</span>
<span class="c">    * Event that is fired when a wire is added</span>
<span class="c">    * You can register this event with myTerminal.eventAddWire.subscribe(function(e,params) { var wire=params[0];}, scope);</span>
<span class="c">    * @event eventAddWire</span>
<span class="c">    */</span>
   <span class="k">this</span><span class="p">.</span><span class="nx">eventAddWire</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">(</span><span class="s2">&quot;eventAddWire&quot;</span><span class="p">);</span>
   
   <span class="c">/**</span>
<span class="c">    * Event that is fired when a wire is removed</span>
<span class="c">    * You can register this event with myTerminal.eventRemoveWire.subscribe(function(e,params) { var wire=params[0];}, scope);</span>
<span class="c">    * @event eventRemoveWire</span>
<span class="c">    */</span>
   <span class="k">this</span><span class="p">.</span><span class="nx">eventRemoveWire</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">(</span><span class="s2">&quot;eventRemoveWire&quot;</span><span class="p">);</span>
   
   
   <span class="c">/**</span>
<span class="c">    * Event that is fired when a container is added</span>
<span class="c">    * You can register this event with myTerminal.eventAddContainer.subscribe(function(e,params) { var container=params[0];}, scope);</span>
<span class="c">    * @event eventAddContainer</span>
<span class="c">    */</span>
   <span class="k">this</span><span class="p">.</span><span class="nx">eventAddContainer</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">(</span><span class="s2">&quot;eventAddContainer&quot;</span><span class="p">);</span>
   
   <span class="c">/**</span>
<span class="c">    * Event that is fired when a container is removed</span>
<span class="c">    * You can register this event with myTerminal.eventRemoveContainer.subscribe(function(e,params) { var container=params[0];}, scope);</span>
<span class="c">    * @event eventRemoveContainer</span>
<span class="c">    */</span>
   <span class="k">this</span><span class="p">.</span><span class="nx">eventRemoveContainer</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">(</span><span class="s2">&quot;eventRemoveContainer&quot;</span><span class="p">);</span>
   
   <span class="c">/**</span>
<span class="c">    * Event that is fired when a container has been moved</span>
<span class="c">    * You can register this event with myTerminal.eventContainerDragged.subscribe(function(e,params) { var container=params[0];}, scope);</span>
<span class="c">    * @event eventContainerDragged</span>
<span class="c">    */</span>
   <span class="k">this</span><span class="p">.</span><span class="nx">eventContainerDragged</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">(</span><span class="s2">&quot;eventContainerDragged&quot;</span><span class="p">);</span>
   
   <span class="c">/**</span>
<span class="c">    * Event that is fired when a container has been resized</span>
<span class="c">    * You can register this event with myTerminal.eventContainerResized.subscribe(function(e,params) { var container=params[0];}, scope);</span>
<span class="c">    * @event eventContainerResized</span>
<span class="c">    */</span>
   <span class="k">this</span><span class="p">.</span><span class="nx">eventContainerResized</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">(</span><span class="s2">&quot;eventContainerResized&quot;</span><span class="p">);</span>
   
   
   <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
   
   <span class="k">this</span><span class="p">.</span><span class="nx">initContainers</span><span class="p">();</span>
   
   <span class="k">this</span><span class="p">.</span><span class="nx">initWires</span><span class="p">();</span>
   
   <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">layerMap</span><span class="p">)</span> <span class="p">{</span> 
      <span class="k">new</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">LayerMap</span><span class="p">({</span><span class="nx">layer</span><span class="o">:</span> <span class="k">this</span><span class="p">});</span>
   <span class="p">}</span>
   
<span class="p">};</span>

<span class="nx">WireIt</span><span class="p">.</span><span class="nx">Layer</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="p">{</span>

   <span class="c">/**</span>
<span class="c">    * @method setOptions</span>
<span class="c">    */</span>
   <span class="nx">setOptions</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">options</span><span class="p">)</span> <span class="p">{</span>
      <span class="c">/**</span>
<span class="c">       * Configuration object of the layer</span>
<span class="c">       * &lt;ul&gt;</span>
<span class="c">       *   &lt;li&gt;className: CSS class name for the layer element (default &#39;WireIt-Layer&#39;)&lt;/li&gt;</span>
<span class="c">       *   &lt;li&gt;parentEl: DOM element that schould contain the layer (default document.body)&lt;/li&gt;</span>
<span class="c">       *   &lt;li&gt;containers: array of container configuration objects&lt;/li&gt;  </span>
<span class="c">       *   &lt;li&gt;wires: array of wire configuration objects&lt;/li&gt;</span>
<span class="c">       * &lt;/ul&gt;</span>
<span class="c">       * @property options</span>
<span class="c">       */</span>
      <span class="k">this</span><span class="p">.</span><span class="nx">options</span> <span class="o">=</span> <span class="p">{};</span>
      <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">className</span> <span class="o">||</span> <span class="s1">&#39;WireIt-Layer&#39;</span><span class="o">;</span>
      <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">parentEl</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">parentEl</span> <span class="o">||</span> <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="o">;</span>
      <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">containers</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">containers</span> <span class="o">||</span> <span class="p">[];</span>
      <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">wires</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">wires</span> <span class="o">||</span> <span class="p">[];</span>
      <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">layerMap</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isUndefined</span><span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">layerMap</span><span class="p">)</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="nx">options</span><span class="p">.</span><span class="nx">layerMap</span><span class="o">;</span>
   <span class="p">}</span><span class="o">,</span>

   <span class="c">/**</span>
<span class="c">    * Create the dom of the layer and insert it into the parent element</span>
<span class="c">    * @method render</span>
<span class="c">    */</span>
   <span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
   
      <span class="k">this</span><span class="p">.</span><span class="nx">el</span> <span class="o">=</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">cn</span><span class="p">(</span><span class="s1">&#39;div&#39;</span><span class="o">,</span> <span class="p">{</span><span class="nx">className</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">className</span><span class="p">}</span> <span class="p">);</span>
   
      <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">parentEl</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>
   <span class="p">}</span><span class="o">,</span>


   <span class="c">/**</span>
<span class="c">    * Create all the containers passed as options</span>
<span class="c">    * @method initContainers</span>
<span class="c">    */</span>
   <span class="nx">initContainers</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
      <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span> <span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">containers</span><span class="p">.</span><span class="nx">length</span> <span class="o">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">addContainer</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
      <span class="p">}</span> 
   <span class="p">}</span><span class="o">,</span>

   <span class="c">/**</span>
<span class="c">    * Create all the wires passed in the config</span>
<span class="c">    * @method initWires</span>
<span class="c">    */</span>
   <span class="nx">initWires</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
      <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span> <span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">wires</span><span class="p">.</span><span class="nx">length</span> <span class="o">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">addWire</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">wires</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
      <span class="p">}</span>
   <span class="p">}</span><span class="o">,</span>

   <span class="c">/**</span>
<span class="c">    * Instanciate a wire given its &quot;xtype&quot; (default to WireIt.Wire)</span>
<span class="c">    * @method addWire</span>
<span class="c">    * @param {Object} wireConfig  Wire configuration object (see WireIt.Wire class for details)</span>
<span class="c">    * @return {WireIt.Wire} Wire instance build from the xtype</span>
<span class="c">    */</span>
   <span class="nx">addWire</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">wireConfig</span><span class="p">)</span> <span class="p">{</span>
      <span class="kd">var</span> <span class="nx">type</span> <span class="o">=</span> <span class="nb">eval</span><span class="p">(</span><span class="nx">wireConfig</span><span class="p">.</span><span class="nx">xtype</span> <span class="o">||</span> <span class="s2">&quot;WireIt.Wire&quot;</span><span class="p">);</span>
   
      <span class="kd">var</span> <span class="nx">src</span> <span class="o">=</span> <span class="nx">wireConfig</span><span class="p">.</span><span class="nx">src</span><span class="o">;</span>
      <span class="kd">var</span> <span class="nx">tgt</span> <span class="o">=</span> <span class="nx">wireConfig</span><span class="p">.</span><span class="nx">tgt</span><span class="o">;</span>
   
      <span class="kd">var</span> <span class="nx">terminal1</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">src</span><span class="p">.</span><span class="nx">moduleId</span><span class="p">].</span><span class="nx">terminals</span><span class="p">[</span><span class="nx">src</span><span class="p">.</span><span class="nx">terminalId</span><span class="p">];</span>
      <span class="kd">var</span> <span class="nx">terminal2</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">tgt</span><span class="p">.</span><span class="nx">moduleId</span><span class="p">].</span><span class="nx">terminals</span><span class="p">[</span><span class="nx">tgt</span><span class="p">.</span><span class="nx">terminalId</span><span class="p">];</span>
   
      <span class="kd">var</span> <span class="nx">wire</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">type</span><span class="p">(</span> <span class="nx">terminal1</span><span class="o">,</span> <span class="nx">terminal2</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>
      <span class="nx">wire</span><span class="p">.</span><span class="nx">redraw</span><span class="p">();</span>
   
      <span class="k">return</span> <span class="nx">wire</span><span class="o">;</span>
   <span class="p">}</span><span class="o">,</span>

   <span class="c">/**</span>
<span class="c">    * Instanciate a container given its &quot;xtype&quot;: WireIt.Container (default) or a subclass of it.</span>
<span class="c">    * @method addContainer</span>
<span class="c">    * @param {Object} containerConfig  Container configuration object (see WireIt.Container class for details)</span>
<span class="c">    * @return {WireIt.Container} Container instance build from the xtype</span>
<span class="c">    */</span>
   <span class="nx">addContainer</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">containerConfig</span><span class="p">)</span> <span class="p">{</span>
   
      <span class="kd">var</span> <span class="nx">type</span> <span class="o">=</span> <span class="nb">eval</span><span class="p">(</span><span class="s1">&#39;(&#39;</span><span class="o">+</span><span class="p">(</span><span class="nx">containerConfig</span><span class="p">.</span><span class="nx">xtype</span> <span class="o">||</span> <span class="s2">&quot;WireIt.Container&quot;</span><span class="p">)</span><span class="o">+</span><span class="s1">&#39;)&#39;</span><span class="p">);</span>
      <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">type</span><span class="p">)</span> <span class="p">{</span>
         <span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">(</span><span class="s2">&quot;WireIt layer unable to add container: xtype &#39;&quot;</span><span class="o">+</span><span class="nx">containerConfig</span><span class="p">.</span><span class="nx">xtype</span><span class="o">+</span><span class="s2">&quot;&#39; not found&quot;</span><span class="p">);</span>
      <span class="p">}</span>
      <span class="kd">var</span> <span class="nx">container</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">type</span><span class="p">(</span><span class="nx">containerConfig</span><span class="o">,</span> <span class="k">this</span><span class="p">);</span>
   
      <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span> <span class="nx">container</span> <span class="p">);</span>
   
      <span class="c">// Event listeners</span>
      <span class="nx">container</span><span class="p">.</span><span class="nx">eventAddWire</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">onAddWire</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
      <span class="nx">container</span><span class="p">.</span><span class="nx">eventRemoveWire</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">onRemoveWire</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
   
      <span class="k">if</span><span class="p">(</span><span class="nx">container</span><span class="p">.</span><span class="nx">ddResize</span><span class="p">)</span> <span class="p">{</span>
         <span class="nx">container</span><span class="p">.</span><span class="nx">ddResize</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;endDragEvent&#39;</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">eventContainerResized</span><span class="p">.</span><span class="nx">fire</span><span class="p">(</span><span class="nx">container</span><span class="p">);</span>
         <span class="p">}</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
      <span class="p">}</span>
      <span class="k">if</span><span class="p">(</span><span class="nx">container</span><span class="p">.</span><span class="nx">dd</span><span class="p">)</span> <span class="p">{</span>
         <span class="nx">container</span><span class="p">.</span><span class="nx">dd</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;endDragEvent&#39;</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">eventContainerDragged</span><span class="p">.</span><span class="nx">fire</span><span class="p">(</span><span class="nx">container</span><span class="p">);</span>
         <span class="p">}</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
      <span class="p">}</span>
   
      <span class="k">this</span><span class="p">.</span><span class="nx">eventAddContainer</span><span class="p">.</span><span class="nx">fire</span><span class="p">(</span><span class="nx">container</span><span class="p">);</span>
   
      <span class="k">return</span> <span class="nx">container</span><span class="o">;</span>
   <span class="p">}</span><span class="o">,</span>

   <span class="c">/**</span>
<span class="c">    * Remove a container</span>
<span class="c">    * @method removeContainer</span>
<span class="c">    * @param {WireIt.Container} container Container instance to remove</span>
<span class="c">    */</span>
   <span class="nx">removeContainer</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">container</span><span class="p">)</span> <span class="p">{</span>
      <span class="kd">var</span> <span class="nx">index</span> <span class="o">=</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">container</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">);</span>
      <span class="k">if</span><span class="p">(</span> <span class="nx">index</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span> <span class="p">)</span> <span class="p">{</span>
         <span class="nx">container</span><span class="p">.</span><span class="nx">remove</span><span class="p">();</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">index</span><span class="p">]</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">containers</span> <span class="o">=</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">compact</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">);</span>
      
         <span class="k">this</span><span class="p">.</span><span class="nx">eventRemoveContainer</span><span class="p">.</span><span class="nx">fire</span><span class="p">(</span><span class="nx">container</span><span class="p">);</span>
      <span class="p">}</span>
   <span class="p">}</span><span class="o">,</span>

   <span class="c">/**</span>
<span class="c">    * Update the wire list when any of the containers fired the eventAddWire</span>
<span class="c">    * @method onAddWire</span>
<span class="c">    * @param {Event} event The eventAddWire event fired by the container</span>
<span class="c">    * @param {Array} args This array contains a single element args[0] which is the added Wire instance</span>
<span class="c">    */</span>
   <span class="nx">onAddWire</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">event</span><span class="o">,</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
      <span class="kd">var</span> <span class="nx">wire</span> <span class="o">=</span> <span class="nx">args</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
      <span class="c">// add the wire to the list if it isn&#39;t in</span>
      <span class="k">if</span><span class="p">(</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">wire</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">wires</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span> <span class="p">)</span> <span class="p">{</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">wires</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">wire</span><span class="p">);</span>
         <span class="c">// Re-Fire an event at the layer level</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">eventAddWire</span><span class="p">.</span><span class="nx">fire</span><span class="p">(</span><span class="nx">wire</span><span class="p">);</span>
      <span class="p">}</span>
   <span class="p">}</span><span class="o">,</span>

   <span class="c">/**</span>
<span class="c">    * Update the wire list when a wire is removed</span>
<span class="c">    * @method onRemoveWire</span>
<span class="c">    * @param {Event} event The eventRemoveWire event fired by the container</span>
<span class="c">    * @param {Array} args This array contains a single element args[0] which is the removed Wire instance</span>
<span class="c">    */</span>
   <span class="nx">onRemoveWire</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">event</span><span class="o">,</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
      <span class="kd">var</span> <span class="nx">wire</span> <span class="o">=</span> <span class="nx">args</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
      <span class="kd">var</span> <span class="nx">index</span> <span class="o">=</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">wire</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">wires</span><span class="p">);</span>
      <span class="k">if</span><span class="p">(</span> <span class="nx">index</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span> <span class="p">)</span> <span class="p">{</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">wires</span><span class="p">[</span><span class="nx">index</span><span class="p">]</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">wires</span> <span class="o">=</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">compact</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">wires</span><span class="p">);</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">eventRemoveWire</span><span class="p">.</span><span class="nx">fire</span><span class="p">(</span><span class="nx">wire</span><span class="p">);</span>
      <span class="p">}</span>
   <span class="p">}</span><span class="o">,</span>

   <span class="c">/**</span>
<span class="c">    * Remove all the containers in this layer (and the associated terminals and wires)</span>
<span class="c">    * @method removeAllContainers</span>
<span class="c">    */</span>
   <span class="nx">removeAllContainers</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
      <span class="k">while</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">removeContainer</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
      <span class="p">}</span>
   <span class="p">}</span><span class="o">,</span>


   <span class="c">/**</span>
<span class="c">    * Return an object that represent the state of the layer including the containers and the wires</span>
<span class="c">    * @method getWiring</span>
<span class="c">    * @return {Obj} layer configuration</span>
<span class="c">    */</span>
   <span class="nx">getWiring</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
   
      <span class="kd">var</span> <span class="nx">i</span><span class="o">;</span>
      <span class="kd">var</span> <span class="nx">obj</span> <span class="o">=</span> <span class="p">{</span><span class="nx">containers</span><span class="o">:</span> <span class="p">[]</span><span class="o">,</span> <span class="nx">wires</span><span class="o">:</span> <span class="p">[]};</span>
   
      <span class="k">for</span><span class="p">(</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span> <span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">.</span><span class="nx">length</span> <span class="o">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
         <span class="nx">obj</span><span class="p">.</span><span class="nx">containers</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span> <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getConfig</span><span class="p">()</span> <span class="p">);</span>
      <span class="p">}</span>
   
      <span class="k">for</span><span class="p">(</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span> <span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">wires</span><span class="p">.</span><span class="nx">length</span> <span class="o">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
         <span class="kd">var</span> <span class="nx">wire</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">wires</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
      
         <span class="kd">var</span> <span class="nx">wireObj</span> <span class="o">=</span> <span class="p">{</span> 
            <span class="nx">src</span><span class="o">:</span> <span class="p">{</span><span class="nx">moduleId</span><span class="o">:</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">wire</span><span class="p">.</span><span class="nx">terminal1</span><span class="p">.</span><span class="nx">container</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">)</span><span class="o">,</span> <span class="nx">terminalId</span><span class="o">:</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">wire</span><span class="p">.</span><span class="nx">terminal1</span><span class="o">,</span> <span class="nx">wire</span><span class="p">.</span><span class="nx">terminal1</span><span class="p">.</span><span class="nx">container</span><span class="p">.</span><span class="nx">terminals</span><span class="p">)}</span><span class="o">,</span> 
            <span class="nx">tgt</span><span class="o">:</span> <span class="p">{</span><span class="nx">moduleId</span><span class="o">:</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">wire</span><span class="p">.</span><span class="nx">terminal2</span><span class="p">.</span><span class="nx">container</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">)</span><span class="o">,</span> <span class="nx">terminalId</span><span class="o">:</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">wire</span><span class="p">.</span><span class="nx">terminal2</span><span class="o">,</span> <span class="nx">wire</span><span class="p">.</span><span class="nx">terminal2</span><span class="p">.</span><span class="nx">container</span><span class="p">.</span><span class="nx">terminals</span><span class="p">)}</span> 
         <span class="p">};</span>
         <span class="nx">obj</span><span class="p">.</span><span class="nx">wires</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">wireObj</span><span class="p">);</span>
      <span class="p">}</span>
   
      <span class="k">return</span> <span class="nx">obj</span><span class="o">;</span>
   <span class="p">}</span><span class="o">,</span>

   <span class="c">/**</span>
<span class="c">    * Load a layer configuration object</span>
<span class="c">    * @method setWiring</span>
<span class="c">    * @param {Object} wiring layer configuration</span>
<span class="c">    */</span>
   <span class="nx">setWiring</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">wiring</span><span class="p">)</span> <span class="p">{</span>
      <span class="k">this</span><span class="p">.</span><span class="nx">removeAllContainers</span><span class="p">();</span>
      
      <span class="k">if</span><span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">wiring</span><span class="p">.</span><span class="nx">containers</span><span class="p">))</span> <span class="p">{</span>
         <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span> <span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">wiring</span><span class="p">.</span><span class="nx">containers</span><span class="p">.</span><span class="nx">length</span> <span class="o">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">addContainer</span><span class="p">(</span><span class="nx">wiring</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
         <span class="p">}</span>
      <span class="p">}</span>
      <span class="k">if</span><span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">wiring</span><span class="p">.</span><span class="nx">wires</span><span class="p">))</span> <span class="p">{</span>
         <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span> <span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">wiring</span><span class="p">.</span><span class="nx">wires</span><span class="p">.</span><span class="nx">length</span> <span class="o">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">addWire</span><span class="p">(</span><span class="nx">wiring</span><span class="p">.</span><span class="nx">wires</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
         <span class="p">}</span>
       <span class="p">}</span>
   <span class="p">}</span><span class="o">,</span>

   <span class="c">/**</span>
<span class="c">    * Alias for removeAllContainers</span>
<span class="c">    * @method clear</span>
<span class="c">    */</span>
   <span class="nx">clear</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
      <span class="k">this</span><span class="p">.</span><span class="nx">removeAllContainers</span><span class="p">();</span>
   <span class="p">}</span><span class="o">,</span>
   
   
   
   <span class="c">/**</span>
<span class="c">    * Layer explosing animation</span>
<span class="c">    * @method clearExplode</span>
<span class="c">    */</span>
   <span class="nx">clearExplode</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">callback</span><span class="o">,</span> <span class="nx">bind</span><span class="p">)</span> <span class="p">{</span>

      <span class="kd">var</span> <span class="nx">center</span> <span class="o">=</span> <span class="p">[</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">floor</span><span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getViewportWidth</span><span class="p">()</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span><span class="o">,</span>
   		            <span class="nb">Math</span><span class="p">.</span><span class="nx">floor</span><span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getViewportHeight</span><span class="p">()</span><span class="o">/</span><span class="mi">2</span><span class="p">)];</span>
      <span class="kd">var</span> <span class="nx">R</span> <span class="o">=</span> <span class="mf">1.2</span><span class="o">*</span><span class="nb">Math</span><span class="p">.</span><span class="nx">sqrt</span><span class="p">(</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">pow</span><span class="p">(</span><span class="nx">center</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">,</span><span class="mi">2</span><span class="p">)</span><span class="o">+</span><span class="nb">Math</span><span class="p">.</span><span class="nx">pow</span><span class="p">(</span><span class="nx">center</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">,</span><span class="mi">2</span><span class="p">));</span>

      <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span> <span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">.</span><span class="nx">length</span> <span class="o">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
          <span class="kd">var</span> <span class="nx">left</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">dbWire</span><span class="p">.</span><span class="nx">layer</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">left</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="mi">0</span><span class="o">,</span><span class="nx">dbWire</span><span class="p">.</span><span class="nx">layer</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">left</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="o">,</span><span class="mi">10</span><span class="p">);</span>
   	    <span class="kd">var</span> <span class="nx">top</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">dbWire</span><span class="p">.</span><span class="nx">layer</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">top</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="mi">0</span><span class="o">,</span><span class="nx">dbWire</span><span class="p">.</span><span class="nx">layer</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">top</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="o">,</span><span class="mi">10</span><span class="p">);</span>

   	    <span class="kd">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sqrt</span><span class="p">(</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">pow</span><span class="p">(</span><span class="nx">left</span><span class="o">-</span><span class="nx">center</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">,</span><span class="mi">2</span><span class="p">)</span><span class="o">+</span><span class="nb">Math</span><span class="p">.</span><span class="nx">pow</span><span class="p">(</span><span class="nx">top</span><span class="o">-</span><span class="nx">center</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">,</span><span class="mi">2</span><span class="p">)</span> <span class="p">);</span>

   	    <span class="kd">var</span> <span class="nx">u</span> <span class="o">=</span> <span class="p">[</span> <span class="p">(</span><span class="nx">left</span><span class="o">-</span><span class="nx">center</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span><span class="o">/</span><span class="nx">d</span><span class="o">,</span> <span class="p">(</span><span class="nx">top</span><span class="o">-</span><span class="nx">center</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span><span class="o">/</span><span class="nx">d</span><span class="p">];</span>
   	    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">el</span><span class="o">,</span> <span class="s2">&quot;opacity&quot;</span><span class="o">,</span> <span class="s2">&quot;0.8&quot;</span><span class="p">);</span>

   	    <span class="kd">var</span> <span class="nx">myAnim</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Anim</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">terminals</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">el</span><span class="o">,</span> <span class="p">{</span>
              <span class="nx">left</span><span class="o">:</span> <span class="p">{</span> <span class="nx">to</span><span class="o">:</span> <span class="nx">center</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">+</span><span class="nx">R</span><span class="o">*</span><span class="nx">u</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="p">}</span><span class="o">,</span>
              <span class="nx">top</span><span class="o">:</span> <span class="p">{</span> <span class="nx">to</span><span class="o">:</span> <span class="nx">center</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">+</span><span class="nx">R</span><span class="o">*</span><span class="nx">u</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="p">}</span><span class="o">,</span>
   	        <span class="nx">opacity</span><span class="o">:</span> <span class="p">{</span> <span class="nx">to</span><span class="o">:</span> <span class="mi">0</span><span class="o">,</span> <span class="nx">by</span><span class="o">:</span> <span class="mf">0.05</span><span class="p">}</span><span class="o">,</span>
   	        <span class="nx">duration</span><span class="o">:</span> <span class="mi">3</span>
          <span class="p">});</span>
          <span class="k">if</span><span class="p">(</span><span class="nx">i</span> <span class="o">==</span> <span class="k">this</span><span class="p">.</span><span class="nx">containers</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
             <span class="nx">myAnim</span><span class="p">.</span><span class="nx">onComplete</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">this</span><span class="p">.</span><span class="nx">clear</span><span class="p">();</span> <span class="nx">callback</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">bind</span><span class="p">);}</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span> 
          <span class="p">}</span>
   	    <span class="nx">myAnim</span><span class="p">.</span><span class="nx">animate</span><span class="p">();</span>
      <span class="p">}</span>

   <span class="p">}</span>
   

<span class="p">};</span>
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class="selected"><a href="module_WireIt.html" title="WireIt">WireIt</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="inputEx.BaseField.html" title="inputEx.BaseField">inputEx.BaseField</a></li>
                                <li class=""><a href="inputEx.Field.html" title="inputEx.Field">inputEx.Field</a></li>
                                <li class=""><a href="WireIt.html" title="WireIt">WireIt</a></li>
                                <li class=""><a href="WireIt.CanvasElement.html" title="WireIt.CanvasElement">WireIt.CanvasElement</a></li>
                                <li class=""><a href="WireIt.Container.html" title="WireIt.Container">WireIt.Container</a></li>
                                <li class=""><a href="WireIt.FormContainer.html" title="WireIt.FormContainer">WireIt.FormContainer</a></li>
                                <li class=""><a href="WireIt.Layer.html" title="WireIt.Layer">WireIt.Layer</a></li>
                                <li class=""><a href="WireIt.LayerMap.html" title="WireIt.LayerMap">WireIt.LayerMap</a></li>
                                <li class=""><a href="WireIt.Scissors.html" title="WireIt.Scissors">WireIt.Scissors</a></li>
                                <li class=""><a href="WireIt.Terminal.html" title="WireIt.Terminal">WireIt.Terminal</a></li>
                                <li class=""><a href="WireIt.TerminalProxy.html" title="WireIt.TerminalProxy">WireIt.TerminalProxy</a></li>
                                <li class=""><a href="WireIt.util.Anim.html" title="WireIt.util.Anim">WireIt.util.Anim</a></li>
                                <li class=""><a href="WireIt.util.DD.html" title="WireIt.util.DD">WireIt.util.DD</a></li>
                                <li class=""><a href="WireIt.util.DDResize.html" title="WireIt.util.DDResize">WireIt.util.DDResize</a></li>
                                <li class=""><a href="WireIt.util.TerminalInput.html" title="WireIt.util.TerminalInput">WireIt.util.TerminalInput</a></li>
                                <li class=""><a href="WireIt.util.TerminalOutput.html" title="WireIt.util.TerminalOutput">WireIt.util.TerminalOutput</a></li>
                                <li class=""><a href="WireIt.Wire.html" title="WireIt.Wire">WireIt.Wire</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="Anim.js.html" title="Anim.js">Anim.js</a></li>
                                <li class=""><a href="CanvasElement.js.html" title="CanvasElement.js">CanvasElement.js</a></li>
                                <li class=""><a href="Container.js.html" title="Container.js">Container.js</a></li>
                                <li class=""><a href="DD.js.html" title="DD.js">DD.js</a></li>
                                <li class=""><a href="DDResize.js.html" title="DDResize.js">DDResize.js</a></li>
                                <li class=""><a href="FormContainer-beta.js.html" title="FormContainer-beta.js">FormContainer-beta.js</a></li>
                                <li class="selected"><a href="Layer.js.html" title="Layer.js">Layer.js</a></li>
                                <li class=""><a href="LayerMap-beta.js.html" title="LayerMap-beta.js">LayerMap-beta.js</a></li>
                                <li class=""><a href="Terminal.js.html" title="Terminal.js">Terminal.js</a></li>
                                <li class=""><a href="WirableField-beta.js.html" title="WirableField-beta.js">WirableField-beta.js</a></li>
                                <li class=""><a href="Wire.js.html" title="Wire.js">Wire.js</a></li>
                                <li class=""><a href="WireIt.js.html" title="WireIt.js">WireIt.js</a></li>
                                <li class=""><a href="WiringEditor.js.html" title="WiringEditor.js">WiringEditor.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2008 Eric Abouaf. All rights reserved.
	</div>
</div>
<script type="text/javascript">
    ALL_YUI_PROPS = [{"access": "", "host": "WireIt.Layer", "name": "addContainer", "url": "WireIt.Layer.html#method_addContainer", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "addTerminal", "url": "WireIt.Container.html#method_addTerminal", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "addWire", "url": "WireIt.Layer.html#method_addWire", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "addWire", "url": "WireIt.Terminal.html#method_addWire", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "bodyEl", "url": "WireIt.Container.html#property_bodyEl", "type": "property"}, {"access": "", "host": "WireIt", "name": "buildModulesList", "url": "WireIt.html#method_buildModulesList", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "clear", "url": "WireIt.Layer.html#method_clear", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "clearExplode", "url": "WireIt.Layer.html#method_clearExplode", "type": "method"}, {"access": "", "host": "WireIt", "name": "cn", "url": "WireIt.html#method_cn", "type": "method"}, {"access": "", "host": "WireIt", "name": "compact", "url": "WireIt.html#method_compact", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "container", "url": "WireIt.Terminal.html#property_container", "type": "property"}, {"access": "", "host": "WireIt.Layer", "name": "containers", "url": "WireIt.Layer.html#property_containers", "type": "property"}, {"access": "", "host": "WireIt.LayerMap", "name": "draw", "url": "WireIt.LayerMap.html#method_draw", "type": "method"}, {"access": "", "host": "WireIt.Wire", "name": "drawArrows", "url": "WireIt.Wire.html#method_drawArrows", "type": "method"}, {"access": "", "host": "WireIt.Wire", "name": "drawBezierCurve", "url": "WireIt.Wire.html#method_drawBezierCurve", "type": "method"}, {"access": "", "host": "WireIt.Wire", "name": "drawStraight", "url": "WireIt.Wire.html#method_drawStraight", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "el", "url": "WireIt.Container.html#property_el", "type": "property"}, {"access": "", "host": "WireIt.Layer", "name": "el", "url": "WireIt.Layer.html#property_el", "type": "property"}, {"access": "", "host": "WireIt.Terminal", "name": "el", "url": "WireIt.Terminal.html#property_el", "type": "property"}, {"access": "", "host": "WireIt.CanvasElement", "name": "element", "url": "WireIt.CanvasElement.html#property_element", "type": "property"}, {"access": "", "host": "WireIt.TerminalProxy", "name": "endDrag", "url": "WireIt.TerminalProxy.html#method_endDrag", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "eventAddContainer", "url": "WireIt.Layer.html#event_eventAddContainer", "type": "event"}, {"access": "", "host": "WireIt.Container", "name": "eventAddWire", "url": "WireIt.Container.html#event_eventAddWire", "type": "event"}, {"access": "", "host": "WireIt.Layer", "name": "eventAddWire", "url": "WireIt.Layer.html#event_eventAddWire", "type": "event"}, {"access": "", "host": "WireIt.Terminal", "name": "eventAddWire", "url": "WireIt.Terminal.html#event_eventAddWire", "type": "event"}, {"access": "", "host": "WireIt.Layer", "name": "eventContainerDragged", "url": "WireIt.Layer.html#event_eventContainerDragged", "type": "event"}, {"access": "", "host": "WireIt.Layer", "name": "eventContainerResized", "url": "WireIt.Layer.html#event_eventContainerResized", "type": "event"}, {"access": "", "host": "WireIt.Layer", "name": "eventRemoveContainer", "url": "WireIt.Layer.html#event_eventRemoveContainer", "type": "event"}, {"access": "", "host": "WireIt.Container", "name": "eventRemoveWire", "url": "WireIt.Container.html#event_eventRemoveWire", "type": "event"}, {"access": "", "host": "WireIt.Layer", "name": "eventRemoveWire", "url": "WireIt.Layer.html#event_eventRemoveWire", "type": "event"}, {"access": "", "host": "WireIt.Terminal", "name": "eventRemoveWire", "url": "WireIt.Terminal.html#event_eventRemoveWire", "type": "event"}, {"access": "", "host": "WireIt.util.DDResize", "name": "eventResize", "url": "WireIt.util.DDResize.html#event_eventResize", "type": "event"}, {"access": "", "host": "WireIt.TerminalProxy", "name": "fakeTerminal", "url": "WireIt.TerminalProxy.html#property_fakeTerminal", "type": "property"}, {"access": "", "host": "WireIt.Container", "name": "getConfig", "url": "WireIt.Container.html#method_getConfig", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "getConnectedTerminals", "url": "WireIt.Terminal.html#method_getConnectedTerminals", "type": "method"}, {"access": "", "host": "WireIt.CanvasElement", "name": "getContext", "url": "WireIt.CanvasElement.html#method_getContext", "type": "method"}, {"access": "", "host": "WireIt", "name": "getIntStyle", "url": "WireIt.html#method_getIntStyle", "type": "method"}, {"access": "", "host": "WireIt.Wire", "name": "getOtherTerminal", "url": "WireIt.Wire.html#method_getOtherTerminal", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "getWiring", "url": "WireIt.Layer.html#method_getWiring", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "getXY", "url": "WireIt.Terminal.html#method_getXY", "type": "method"}, {"access": "", "host": "WireIt.Scissors", "name": "hide", "url": "WireIt.Scissors.html#method_hide", "type": "method"}, {"access": "", "host": "WireIt.Scissors", "name": "hideNow", "url": "WireIt.Scissors.html#method_hideNow", "type": "method"}, {"access": "", "host": "WireIt", "name": "indexOf", "url": "WireIt.html#method_indexOf", "type": "method"}, {"access": "", "host": "WireIt", "name": "init", "url": "WireIt.html#method_init", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "initContainers", "url": "WireIt.Layer.html#method_initContainers", "type": "method"}, {"access": "", "host": "WireIt.LayerMap", "name": "initEvents", "url": "WireIt.LayerMap.html#method_initEvents", "type": "method"}, {"access": "", "host": "WireIt.Scissors", "name": "initScissors", "url": "WireIt.Scissors.html#method_initScissors", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "initTerminals", "url": "WireIt.Container.html#method_initTerminals", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "initWires", "url": "WireIt.Layer.html#method_initWires", "type": "method"}, {"access": "", "host": "WireIt.TerminalProxy", "name": "isValidWireTerminal", "url": "WireIt.TerminalProxy.html#method_isValidWireTerminal", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "layer", "url": "WireIt.Container.html#property_layer", "type": "property"}, {"access": "", "host": "WireIt", "name": "loadModules", "url": "WireIt.html#method_loadModules", "type": "method"}, {"access": "", "host": "WireIt", "name": "loadModulesFailure", "url": "WireIt.html#method_loadModulesFailure", "type": "method"}, {"access": "", "host": "WireIt", "name": "loadModulesSuccess", "url": "WireIt.html#method_loadModulesSuccess", "type": "method"}, {"access": "", "host": "WireIt.Scissors", "name": "mouseOver", "url": "WireIt.Scissors.html#method_mouseOver", "type": "method"}, {"access": "", "host": "WireIt.util.Anim", "name": "moveWireItWires", "url": "WireIt.util.Anim.html#method_moveWireItWires", "type": "method"}, {"access": "", "host": "WireIt.util.DDResize", "name": "myConf", "url": "WireIt.util.DDResize.html#property_myConf", "type": "property"}, {"access": "", "host": "WireIt", "name": "onAddModule", "url": "WireIt.html#method_onAddModule", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "onAddWire", "url": "WireIt.Container.html#method_onAddWire", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "onAddWire", "url": "WireIt.Layer.html#method_onAddWire", "type": "method"}, {"access": "", "host": "inputEx.Field", "name": "onAddWire", "url": "inputEx.Field.html#method_onAddWire", "type": "method"}, {"access": "", "host": "WireIt.LayerMap", "name": "onClick", "url": "WireIt.LayerMap.html#method_onClick", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "onCloseButton", "url": "WireIt.Container.html#method_onCloseButton", "type": "method"}, {"access": "", "host": "WireIt.TerminalProxy", "name": "onDrag", "url": "WireIt.TerminalProxy.html#method_onDrag", "type": "method"}, {"access": "", "host": "WireIt.util.DD", "name": "onDrag", "url": "WireIt.util.DD.html#method_onDrag", "type": "method"}, {"access": "", "host": "WireIt.util.DDResize", "name": "onDrag", "url": "WireIt.util.DDResize.html#method_onDrag", "type": "method"}, {"access": "", "host": "WireIt.TerminalProxy", "name": "onDragDrop", "url": "WireIt.TerminalProxy.html#method_onDragDrop", "type": "method"}, {"access": "", "host": "WireIt.TerminalProxy", "name": "onDragEnter", "url": "WireIt.TerminalProxy.html#method_onDragEnter", "type": "method"}, {"access": "", "host": "WireIt.TerminalProxy", "name": "onDragOut", "url": "WireIt.TerminalProxy.html#method_onDragOut", "type": "method"}, {"access": "", "host": "WireIt", "name": "onHelp", "url": "WireIt.html#method_onHelp", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "onMouseDown", "url": "WireIt.Container.html#method_onMouseDown", "type": "method"}, {"access": "", "host": "WireIt.util.DDResize", "name": "onMouseDown", "url": "WireIt.util.DDResize.html#method_onMouseDown", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "onRemoveWire", "url": "WireIt.Container.html#method_onRemoveWire", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "onRemoveWire", "url": "WireIt.Layer.html#method_onRemoveWire", "type": "method"}, {"access": "", "host": "inputEx.Field", "name": "onRemoveWire", "url": "inputEx.Field.html#method_onRemoveWire", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "onResize", "url": "WireIt.Container.html#method_onResize", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "options", "url": "WireIt.Container.html#property_options", "type": "property"}, {"access": "", "host": "WireIt.Layer", "name": "options", "url": "WireIt.Layer.html#property_options", "type": "property"}, {"access": "", "host": "WireIt.LayerMap", "name": "options", "url": "WireIt.LayerMap.html#property_options", "type": "property"}, {"access": "", "host": "WireIt.Terminal", "name": "options", "url": "WireIt.Terminal.html#property_options", "type": "property"}, {"access": "", "host": "WireIt.Wire", "name": "options", "url": "WireIt.Wire.html#property_options", "type": "property"}, {"access": "", "host": "WireIt.Terminal", "name": "parentEl", "url": "WireIt.Terminal.html#property_parentEl", "type": "property"}, {"access": "", "host": "WireIt.Wire", "name": "parentEl", "url": "WireIt.Wire.html#property_parentEl", "type": "property"}, {"access": "", "host": "WireIt.Wire", "name": "redraw", "url": "WireIt.Wire.html#method_redraw", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "redrawAllTerminals", "url": "WireIt.Container.html#method_redrawAllTerminals", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "redrawAllWires", "url": "WireIt.Terminal.html#method_redrawAllWires", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "remove", "url": "WireIt.Container.html#method_remove", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "remove", "url": "WireIt.Terminal.html#method_remove", "type": "method"}, {"access": "", "host": "WireIt.Wire", "name": "remove", "url": "WireIt.Wire.html#method_remove", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "removeAllContainers", "url": "WireIt.Layer.html#method_removeAllContainers", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "removeAllTerminals", "url": "WireIt.Container.html#method_removeAllTerminals", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "removeAllWires", "url": "WireIt.Terminal.html#method_removeAllWires", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "removeContainer", "url": "WireIt.Layer.html#method_removeContainer", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "removeFocus", "url": "WireIt.Container.html#method_removeFocus", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "removeWire", "url": "WireIt.Terminal.html#method_removeWire", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "render", "url": "WireIt.Container.html#method_render", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "render", "url": "WireIt.Layer.html#method_render", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "render", "url": "WireIt.Terminal.html#method_render", "type": "method"}, {"access": "", "host": "WireIt.FormContainer", "name": "render", "url": "WireIt.FormContainer.html#method_render", "type": "method"}, {"access": "", "host": "inputEx.Field", "name": "render", "url": "inputEx.Field.html#method_render", "type": "method"}, {"access": "", "host": "WireIt", "name": "renderButtons", "url": "WireIt.html#method_renderButtons", "type": "method"}, {"access": "", "host": "WireIt.FormContainer", "name": "renderForm", "url": "WireIt.FormContainer.html#method_renderForm", "type": "method"}, {"access": "", "host": "inputEx.Field", "name": "renderTerminal", "url": "inputEx.Field.html#method_renderTerminal", "type": "method"}, {"access": "", "host": "WireIt", "name": "saveModule", "url": "WireIt.html#method_saveModule", "type": "method"}, {"access": "", "host": "WireIt.Scissors", "name": "scissorClick", "url": "WireIt.Scissors.html#method_scissorClick", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "setBody", "url": "WireIt.Container.html#method_setBody", "type": "method"}, {"access": "", "host": "WireIt.CanvasElement", "name": "SetCanvasRegion", "url": "WireIt.CanvasElement.html#method_SetCanvasRegion", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "setDropInvitation", "url": "WireIt.Terminal.html#method_setDropInvitation", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "setFocus", "url": "WireIt.Container.html#method_setFocus", "type": "method"}, {"access": "", "host": "WireIt.Container", "name": "setOptions", "url": "WireIt.Container.html#method_setOptions", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "setOptions", "url": "WireIt.Layer.html#method_setOptions", "type": "method"}, {"access": "", "host": "WireIt.LayerMap", "name": "setOptions", "url": "WireIt.LayerMap.html#method_setOptions", "type": "method"}, {"access": "", "host": "WireIt.Terminal", "name": "setOptions", "url": "WireIt.Terminal.html#method_setOptions", "type": "method"}, {"access": "", "host": "WireIt.util.TerminalInput", "name": "setOptions", "url": "WireIt.util.TerminalInput.html#method_setOptions", "type": "method"}, {"access": "", "host": "WireIt.util.TerminalOutput", "name": "setOptions", "url": "WireIt.util.TerminalOutput.html#method_setOptions", "type": "method"}, {"access": "", "host": "WireIt.Wire", "name": "setOptions", "url": "WireIt.Wire.html#method_setOptions", "type": "method"}, {"access": "", "host": "WireIt.FormContainer", "name": "setOptions", "url": "WireIt.FormContainer.html#method_setOptions", "type": "method"}, {"access": "", "host": "inputEx.Field", "name": "setOptions", "url": "inputEx.Field.html#method_setOptions", "type": "method"}, {"access": "", "host": "WireIt.Scissors", "name": "setPosition", "url": "WireIt.Scissors.html#method_setPosition", "type": "method"}, {"access": "", "host": "WireIt.util.Anim", "name": "setTerminals", "url": "WireIt.util.Anim.html#method_setTerminals", "type": "method"}, {"access": "", "host": "WireIt.util.DD", "name": "setTerminals", "url": "WireIt.util.DD.html#method_setTerminals", "type": "method"}, {"access": "", "host": "WireIt.Layer", "name": "setWiring", "url": "WireIt.Layer.html#method_setWiring", "type": "method"}, {"access": "", "host": "WireIt.Scissors", "name": "show", "url": "WireIt.Scissors.html#method_show", "type": "method"}, {"access": "", "host": "WireIt", "name": "sn", "url": "WireIt.html#method_sn", "type": "method"}, {"access": "", "host": "WireIt.TerminalProxy", "name": "startDrag", "url": "WireIt.TerminalProxy.html#method_startDrag", "type": "method"}, {"access": "", "host": "WireIt.TerminalProxy", "name": "termConfig", "url": "WireIt.TerminalProxy.html#property_termConfig", "type": "property"}, {"access": "", "host": "WireIt.Scissors", "name": "_terminal", "url": "WireIt.Scissors.html#property__terminal", "type": "property"}, {"access": "", "host": "WireIt.TerminalProxy", "name": "terminal", "url": "WireIt.TerminalProxy.html#property_terminal", "type": "property"}, {"access": "", "host": "WireIt.Wire", "name": "terminal1", "url": "WireIt.Wire.html#property_terminal1", "type": "property"}, {"access": "", "host": "WireIt.Wire", "name": "terminal2", "url": "WireIt.Wire.html#property_terminal2", "type": "property"}, {"access": "", "host": "WireIt.Container", "name": "terminals", "url": "WireIt.Container.html#property_terminals", "type": "property"}, {"access": "", "host": "WireIt", "name": "util", "url": "WireIt.html#property_util", "type": "property"}, {"access": "", "host": "WireIt.util.Anim", "name": "_WireItTerminals", "url": "WireIt.util.Anim.html#property__WireItTerminals", "type": "property"}, {"access": "", "host": "WireIt.util.DD", "name": "_WireItTerminals", "url": "WireIt.util.DD.html#property__WireItTerminals", "type": "property"}, {"access": "", "host": "WireIt.Container", "name": "wires", "url": "WireIt.Container.html#property_wires", "type": "property"}, {"access": "", "host": "WireIt.Layer", "name": "wires", "url": "WireIt.Layer.html#property_wires", "type": "property"}, {"access": "", "host": "WireIt.Terminal", "name": "wires", "url": "WireIt.Terminal.html#property_wires", "type": "property"}, {"access": "", "host": "WireIt", "name": "WiringEditor", "url": "WireIt.html#property_WiringEditor", "type": "property"}];
</script>
</body>
</html>
